package DMSXL._2023Before.HashTable;

/*public class twoSum_ {
    public static void main(String[] args) {
        Solution solution = new Solution();
        int[] nums = {3,3};
        int target = 6;
        int[] index = solution.twoSum(nums,target);
        for (int i = 0; i < index.length; i++) {
            System.out.println(index[i]);
        }
    }
}
class Solution {
    public int[] twoSum(int[] nums, int target) {
        HashMap<Integer, Integer> HashMap = new HashMap<>();
        int[] index = new int[2];
        for (int i = 0; i < nums.length; i++) {
            if(HashMap.containsKey(target - nums[i])){
                index[0] = i;
                index[1] = HashMap.get(target - nums[i]).intValue();
                break;
            }
            HashMap.put(nums[i],i);
        }
        return index;
    }
}*/